<?php if($att['type'] == 4): ?>
<div class="form-group">
	<label for="a_<?php echo $att['id']; ?>_v" class="control-label"><?php echo $att['title']; ?>: 60.00 kr.</label>
	<?php 
	$valuefind = false;
	if(trim($_POST['a_'.$att['id'].'_v_input']) != '')
	{ $valuefind = true; }
	
	$trueValId = 0;
	$falseValId = 0;
	$curValId = 0;
	
	if(count($shop->getProductAttribute($att['id'])->getValues()) > 1)
	{
		foreach($shop->getProductAttribute($att['id'])->getValues() as $val)
		{
			if(($val->getActive()) && (is_object($shop->CurrentProduct->getVariationByAttributeValueId($att['id'], $val->getId()))))
			{
				if(($falseValId == 0) || ($trueValId == 0))
				{
					if(($val->getValue() != '') && 
					   (strtolower($val->getValue()) != 'no') && 
					   (strtolower($val->getValue()) != 'nei') && 
					   (strtolower($val->getValue()) != 'ne') && 
					   (strtolower($val->getValue()) != 'none') && 
					   (strtolower($val->getValue()) != 'ingen') && 
					   (strtolower($val->getValue()) != 'nema') && 
					   (strtolower($val->getValue()) != 'false'))
					{ $trueValId = $val->getId(); }
					else
					{ $falseValId = $val->getId(); }
				}
			}
		}
		$curValId = $falseValId;
		if($valuefind == true)
		{ $curValId = $trueValId; }
	}
	?>
	<input type="hidden" id="a_<?php echo $att['id']; ?>_v" name="a_<?php echo $att['id']; ?>_v" value="<?php echo $curValId; ?>"  />
    <input class="a_<?php echo $att['id']; ?>_v_input form-control" id="a_<?php echo $att['id']; ?>_v_input" type="text" maxlength="50" name="a_<?php echo $att['id']; ?>_v_input" value="<?php echo $_POST['a_'.$att['id'].'_v_input']; ?>" placeholder="<?php echo $att['title']; ?>" />
	<?php 
		$button[0]['title']=ucfirst($txt->getWord('update'));
		$button[0]['onclick']='setAttUploadValue('.$att['id'].', 4, '.$trueValId.', '.$falseValId.', '.$curValId.', jQuery(\'#a_'.$att['id'].'_v_input\').val());';
		$button[0]['params']['class'] = 'btn btn-default btn-block';
		$button[0]['params']['icon'] = 'fa fa-refresh';
		echo getButtonsHTML($theme->HFBSets[$theme->HFB]['button'], $button, 1);
	?>
	<span class="help-block">(maks 50 tegn)</span>
</div>
<script type="text/javascript">
jQuery('#a_<?php echo $att['id']; ?>_v_input').change(function() 
{ setAttUploadValue(<?php echo $att['id']; ?>, 4, <?php echo $trueValId; ?>, <?php echo $falseValId; ?>, <?php echo $curValId; ?>, jQuery(this).val()); });
jQuery('#a_<?php echo $att['id']; ?>_v_input').keyup(function() 
{ setAttUploadValue(<?php echo $att['id']; ?>, 4, <?php echo $trueValId; ?>, <?php echo $falseValId; ?>, <?php echo $curValId; ?>, jQuery(this).val()); });
</script>
<?php
unset($trueValId);
unset($falseValId);
unset($curValId);
?>
<?php endif; ?>